package org.wutopia.labcloud.library.common.base;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class CodedMessage<T> {

    /**
     * 约定的成功标志
     */
    public static final Integer CODE_SUCCESS = 0;
    /**
     * 默认的失败标志，其他失败含义可以自定义
     */
    public static final Integer CODE_DEFAULT_FAILURE = 1;

    private Integer code;
    private String message;
    private T data;

    public CodedMessage(Integer code, String message) {
        setCode(code);
        setMessage(message);
    }

}
